<script>
	/**
	 * vuex管理登陆状态，具体可以参考官方登陆模板示例
	 */
	import {
		mapMutations
	} from 'vuex';
	export default {
		methods: {
			...mapMutations(['login'])
		},
		// #ifdef MP
		onLaunch: function() {
		    const updateManager = uni.getUpdateManager();
		    updateManager.onCheckForUpdate(function(res) {
		        // 请求完新版本信息的回调
		        console.log(res.hasUpdate);
		    });
		    updateManager.onUpdateReady(function(res) {
		        uni.showModal({
		            title: '更新提示',
		            content: '发现新版本，点击确定重启应用',
		            success(res) {
		                if (res.confirm) {
		                    // 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
		                    updateManager.applyUpdate();
		                }
		            }
		        });
		    });
		    updateManager.onUpdateFailed(function(res) {
		        // 新的版本下载失败
		    });
		
		},
		// #endif
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
	}
</script>

<style lang='scss'>
	
	/* #ifndef APP-PLUS-NVUE */
	/*
		全局公共样式和字体图标
	*/
	
	
	view,
	scroll-view,
	swiper,
	swiper-item,
	cover-view,
	cover-image,
	icon,
	text,
	rich-text,
	progress,
	button,
	checkbox,
	form,
	input,
	label,
	radio,
	slider,
	switch,
	textarea,
	navigator,
	audio,
	camera,
	image,
	video {
		box-sizing: border-box;
	}
	/* 导航栏占位符 */
	.place{
		background-color: $nav-place-home;
		height: var(--status-bar-height);
	}
	
	.example-body {
		/* #ifndef APP-NVUE */
		display: block;
		/* #endif */
		padding: 0;
	}
	
	.city {
		/* #ifndef APP-PLUS-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
		// width: 160rpx;
		margin-left: 4px;
	}
	.uni-nav-bar-text {
		font-size: $uni-font-size-base;
		color: $uni-text-color-inverse;
	}
	.input-view {
		/* #ifndef APP-PLUS-NVUE */
		display: flex;
		/* #endif */
		position: absolute;
		top: 50rpx;
		z-index: 9999;
		flex-direction: row;
		width: 500rpx;
		flex: 1;
		background-color: $uni-bg-color-grey;
		height: $nav-height;
		border-radius: 35rpx;
		padding: 0 15px;
		height: 59rpx;
		flex-wrap: nowrap;
		/* margin: 7px 0; */
		line-height: $nav-height;
	}
	.input-uni-icon {
		line-height: $nav-height;
	}
	.nav-bar-input {
		height: $nav-height;
		line-height: $nav-height;
		/* #ifdef APP-PLUS-NVUE */
		width: 370rpx;
		/* #endif */
		padding: 0 5px;
		font-size: $uni-font-size-base;
		background-color: $uni-bg-color-grey;
	}
	
	/* 骨架屏替代方案 */
	.Skeleton {
		background: #f3f3f3;
		padding: 20upx 0;
		border-radius: 8upx;
	}

	/* 图片载入替代方案 */
	.image-wrapper {
		font-size: 0;
		background: #f3f3f3;
		border-radius: 4px;

		image {
			width: 100%;
			height: 100%;
			transition: .6s;
			opacity: 0;

			&.loaded {
				opacity: 1;
			}
		}
	}

	.clamp {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		display: block;
	}

	.common-hover {
		background: #f5f5f5;
	}
	

	/*边框*/
	.b-b:after,
	.b-t:after {
		position: absolute;
		z-index: 3;
		left: 0;
		right: 0;
		height: 0;
		content: '';
		transform: scaleY(.5);
		border-bottom: 1px solid $border-color-base;
	}

	.b-b:after {
		bottom: 0;
	}

	.b-t:after {
		top: 0;
	}

	/* button样式改写 */
	uni-button,
	button {
		height: 80upx;
		line-height: 80upx;
		font-size: $font-lg + 2upx;
		font-weight: normal;

		&.no-border:before,
		&.no-border:after {
			border: 0;
		}
	}

	uni-button[type=default],
	button[type=default] {
		color: $font-color-dark;
	}

	/* input 样式 */
	.input-placeholder {
		color: #999999;
	}

	.placeholder {
		color: #999999;
	}
	
	/* #endif */
</style>
